Skip to content

fixed multiform passing#62

Merged
winzamark123 merged 3 commits into
mainfrom
fix/multiform
Sep 12, 2025
Merged

fixed multiform passing#62
winzamark123 merged 3 commits into
mainfrom
fix/multiform

Conversation

@winzamark123

@winzamark123 winzamark123 commented Sep 11, 2025

Copy link
Copy Markdown
Contributor

Refactor File Upload Utility and Update Test URL

This PR refactors the createFileUploadFormData utility function to streamline its API and simplify form data construction:

  • The function now takes only two parameters: the file (Blob | Buffer) and a body object containing additional data.
  • The file is always uploaded with the key "file", and all additional fields are serialized into a JSON string and appended as "body".
  • This removes the need for custom file field names and complex handling of arrays/objects in form data.
  • Additionally, the webpage test URL in tests/web.test.ts is updated from https://example.com to https://www.google.com to ensure reliability and accessibility in tests.

@Khurdhula-Harshavardhan Khurdhula-Harshavardhan left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aside from the one test case that is commented out, everything looks good to me.

Comment thread tests/web.test.ts Outdated
// const result = await client.web.ai_scrape({
// url: TEST_URLS.webpage,
// element_prompts: ["Find main content"],
// root_element_selector: "body",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of commenting this out, use a root_element_selector: "main" and see if that works.

@winzamark123
winzamark123 merged commit 0de2a77 into main Sep 12, 2025
2 checks passed
@winzamark123
winzamark123 deleted the fix/multiform branch September 12, 2025 16:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants